import { defHttp } from "@/utils/http";

// ERP 产品单位 VO
export interface drugUnitVO {
	id: number; // 单位编号
	name: string; // 单位名字
	status: number; // 单位状态
}

// ERP 产品单位 API
export const drugUnitApi = {
	// 查询产品单位分页
	getdrugUnitPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/drug-units/page`, params });
	},

	// 查询产品单位精简列表
	getdrugUnitSimpleList: async () => {
		return await defHttp.get({ url: `/whs/drug-units/simple-list` });
	},

	// 查询产品单位详情
	getdrugUnit: async (id: number) => {
		return await defHttp.get({ url: `/whs/drug-units/get?id=` + id });
	},

	// 新增产品单位
	createdrugUnit: async (data: drugUnitVO) => {
		return await defHttp.post({ url: `/whs/drug-units/create`, data });
	},

	// 修改产品单位
	updatedrugUnit: async (data: drugUnitVO) => {
		return await defHttp.put({ url: `/whs/drug-units/update`, data });
	},

	// 删除产品单位
	deletedrugUnit: async (id: number) => {
		return await defHttp.delete({ url: `/whs/drug-units/delete?id=` + id });
	},

	// 导出产品单位 Excel
	exportdrugUnit: async (params: any) => {
		return await defHttp.download({ url: `/whs/drug-units/export-excel`, params });
	}
};
